<?php

use IDock\Printer\ProposalStatusPrinter;
use IDock\Visitor\EPolicyDownloadVisitor;
use IDock\Visitor\NonCar\NonCarInquiryVisitor;
use IDock\Visitor\NonCar\NonCarPaymentVisitor;
use IDock\Visitor\PolicyInfoVisitor;
use IDock\Visitor\PolicyPaymentVisitor;
use IDock\Visitor\Premium\PremiumCarTaxVisitor;
use IDock\Visitor\Premium\PremiumChargingPileVisitor;
use IDock\Visitor\Premium\PremiumCoverageVisitor;
use IDock\Visitor\Premium\PremiumExtInfoVisitor;
use IDock\Visitor\Premium\PremiumInquiryVisitor;
use IDock\Visitor\Premium\PremiumPolicyVisitor;
use IDock\Visitor\Premium\PremiumRelationVisitor;
use IDock\Visitor\Premium\PremiumUnderwritingVisitor;
use IDock\Visitor\Premium\PremiumVehicleVisitor;
use IDock\Visitor\ProposalRecallVisitor;
use IDock\Visitor\ProposalStatusVisitor;
use IDock\Visitor\RenewalInquiryVisitor;
use IDock\Visitor\UnderwritingRecallVisitor;
use IDock\Visitor\UploadFileVisitor;
use IDock\Visitor\VehicleActualValueVisitor;
use IDock\Visitor\VehicleModelVisitor;

require_once('./vendor/autoload.php');

$IDock = new \IDock\IDock\IDock();

$DAJIAConfig = [
    'gateway' => '*************',
    'channelCode' => '*************',
    'channelPwd' => '*************',
    'secretKey' => '*************',
    'deviceType' => '*************',
    'logsDir' => './DAJIALogs',
    'timeout' => '60',
    'proxy' => '*************',
];

require_once('config.php');

$IDock->setBean('DAJIA', $DAJIAConfig);


global $testResponse;

$testResponse = '{"data":"24605DAFCAAACE9D3D1709A1A568DC2DCC1CFB6BBEF4E2C04CB5BA3145E32F2E36CA5976F3F74162A93D6EF1AC5CC5C4B98D73DBFE42A31C766725DA630A23318E430D0FEDACBBCF8DF7FB2C0279354EE0F74E03DADB998900CDB63275EF8C605D2D3F077651D68A46EB2DBFEDD29AE98C7608E3EE28231ED51730F357DE244F8E628B92C8D8040D86ACC6BF75EE518FDEB265C8557FA5D33214B61C1A5AE1C5718B09C90D1911E935F108540D9EB8979D00C2C5A4A21BE9EF58232BEDA44C2EBB3D48DA618E121064D9D85EE75E89DA0178333CBB8D9A585CA513370B7323CB6B5A5C2A69DC2BA71D9676368FA3980EC71361DF7A67AFB0274E0DB235CE411E6D53C9DC9F768675FFE74352281E0B1F8C93741692074C662C47FB77BCC25EE433660981482A783DD5490A67E2A0EDC417B93AD4FBFC7A5A9415E62CB402946568BF6D37A3A031EFD446B2E485A8960F706F5ED0BF2DFF91146A9F241320C7DA50659694337B3872BC3BBD23E0DDBEAE0D0ABE42820DD2A5248FB6BEC61191A81AC0724774206E45D41B934E552E724A9FEF8D141829A8D5F4378E672E7ECA211D4C6B00B7DBA7376749B3909B1A577FE3BDF769984003DE9C6381B3CC48D768220CA666917064AA6517A4077CAD76DC9EB8D15B3CC545BE82F687EF07CC3FEE090C8A54DB4347F68C1A2C82BB604992F75249D5388A6DB1BCA044F89165D33802D904088649F725FFCB3574AF8652892E111F3790DF190F30CB6989652CE1C1E5F084351C04B049AAA6216D70EA228E331BDEF61FC9CA268665ABDD05877DD1A757A1F35CB31F0CEB81CCD019E39BE6E2B26F3001528F1EF94645926DDF9BD6","signature":"9b05bc5c20ab3ee4ead3d7641b10a294","timestamp":"1702625282141"}';

$shortName = 'DAJIA';
//$shortName = 'ACIC';


$vin = 'LVHRU2602J5074919';
$engineNo = 'G4788455';
$licenseNo = '';
$firstRegisterDate = '2023-09-27';
$vehicleModel = 'WCD1133TJF';

$DAJIAOrderNo = 'D20230807070000002041570f983d914';//

$biStartData = '2022-10-31 00:00:00';
$ciStartData = '2022-10-31 00:00:00';
$biEndData = '2023-10-30 23:59:59';
$ciEndData = '2023-10-30 23:59:59';

//$engineNo = 'SVW71217DN';
//$vin = 'LSVGZ6183J2037364';

try {


//续保查询接口
    if (0) {
        //续保查询接口
        $renewalInquiryVisitor = new RenewalInquiryVisitor();
        //车架号
        $renewalInquiryVisitor->vin = $vin;
        //发动机号
        $renewalInquiryVisitor->engineNo = $engineNo;
        //车牌号
        $renewalInquiryVisitor->licenseNo = $licenseNo;
        $renewalInquiryVisitor->argc['startAt'] = '2023-12-15';
        $renewalInquiryVisitor->argc['endAt'] = '2023-12-15';
        $renewalInquiryVisitor->argc['inquiryNo'] = '';

        $response = $IDock->renewalInquiry($shortName, $renewalInquiryVisitor);

        var_dump($response->isSuccess());
        var_dump($response->getError());

        /**
         * @var $printer \IDock\Printer\RenewalInquiryPrinter
         */
        $printer = $response->getPrinter();
        if($printer) var_dump($printer->toArray());
        exit;
    }
    //非车产品列表
    if(0){
        $nonCarProductListVisitor = new \IDock\Visitor\NonCar\NonCarProductListVisitor();
        $response = $IDock->nonCarProductList($shortName,$nonCarProductListVisitor);

        var_dump($response->isSuccess());
        var_dump($response->getError());
        var_dump($response->printer);
    }

//车辆车型查询接口
    if (0) {
        //车辆车型查询接口
        $vehicleModelVisitor = new VehicleModelVisitor();
        //车架号
        $vehicleModelVisitor->vin = $vin;
        //$vehicleModelVisitor->vin = '';
        //发动机号
        $vehicleModelVisitor->engineNo = $engineNo;
        //车牌号
        $vehicleModelVisitor->licenseNo = $licenseNo;
        //初登时间
        $vehicleModelVisitor->firstRegisterDate = $firstRegisterDate;
        //车型编码
        $vehicleModelVisitor->vehicleModel = $vehicleModel;
        //$vehicleModelVisitor->vehicleModel = '';
        $vehicleModelVisitor->argc['areaCode'] = '51';
        $vehicleModelVisitor->argc['cDptCde'] = '07000002';
        $vehicleModelVisitor->argc['orderNo'] = $DAJIAOrderNo;

        $response = $IDock->vehicleModel($shortName, $vehicleModelVisitor);
        var_dump($response->isSuccess());
        var_dump($response->getError());

        /**
         * @var $printer \IDock\Printer\VehicleModelPrinter
         */
        $printer = $response->getPrinter();
        if($printer) var_dump($printer->toArray());
        exit;
    }

//车辆实际价格
    if (0) {
        //车辆实际价格
        $vehicleActualValueVisitor = new VehicleActualValueVisitor();
        $vehicleActualValueVisitor->startDate = $biStartData;
        $vehicleActualValueVisitor->firstRegisterDate = $firstRegisterDate;
        //车辆价格
        $vehicleActualValueVisitor->vehiclePrice = '54800';
        //能源类型
        $vehicleActualValueVisitor->energyType = 'E01';
        //是否新能源
        $vehicleActualValueVisitor->isNewEnergy = false;
        //使用性质
        $vehicleActualValueVisitor->useNatureCode = '01';
        //车辆用途
        $vehicleActualValueVisitor->causeType = '001';
        //车辆种类
        $vehicleActualValueVisitor->carKindCode = '100';
        //座位数
        $vehicleActualValueVisitor->vehicleSeat = '5';
        //荷载质量
        $vehicleActualValueVisitor->vehicleTonnage = '0';

        $vehicleActualValueVisitor->argc['orderNo'] = $DAJIAOrderNo;

        $response = $IDock->vehicleActualValue($shortName, $vehicleActualValueVisitor);
        var_dump($response->isSuccess());
        var_dump($response->getError());

        /**
         * @var $printer \IDock\Printer\VehicleActualValuePrinter
         */
        $printer = $response->getPrinter();
        var_dump($printer->toArray());
        exit;
    }

//询价前置
//保费计算
//核保
    if (0) {

        /**
         * 询价主信息
         */
        $premiumInquiryVisitor = new PremiumInquiryVisitor();
        //商业险起保日期
        $premiumInquiryVisitor->biStartData = $biStartData;
        //商业险终保日期
        $premiumInquiryVisitor->biEndData = $biEndData;
        //交强险起保日期
        $premiumInquiryVisitor->ciStartData = $ciStartData;
        //交强险终保日期
        $premiumInquiryVisitor->ciEndData = $ciEndData;
        //商业险即时生效
        $premiumInquiryVisitor->biEffectFlag = false;
        //交强险即时生效
        $premiumInquiryVisitor->ciEffectFlag = false;

        $premiumInquiryVisitor->isNewEnergy = false;

        /**
         * 车辆信息
         */
        $premiumVehicleVisitor = new PremiumVehicleVisitor();
        //是否新车
        $premiumVehicleVisitor->isNewVehicle = '1';
        //车架号
        $premiumVehicleVisitor->vin = $vin;
        //发动机号
        $premiumVehicleVisitor->engineNo = $engineNo;
        //车牌号
        $premiumVehicleVisitor->licenseNo = $licenseNo;
        //初登时间
        $premiumVehicleVisitor->firstRegisterDate = $firstRegisterDate;
        //过户时间
        $premiumVehicleVisitor->transferDate = '';
        //是否过户车
        $premiumVehicleVisitor->isTransfer = '0';
        //发证时间
        $premiumVehicleVisitor->issueDate = '';
        //车型编码
        $premiumVehicleVisitor->vehicleModel = $vehicleModel;
        //车型编码代码
        $premiumVehicleVisitor->vehicleModelCode = 'WCD1133TJF';
        //$premiumVehicleVisitor->vehicleModelCode = 'BTYOSPUB0014';
        //车型名称
        $premiumVehicleVisitor->vehicleName = '丰田TV7152X轿车';
        //车价
        $premiumVehicleVisitor->vehiclePrice = '85535';
        //车价含税
        $premiumVehicleVisitor->vehiclePriceTax = '85535';
        //协商价格
        $premiumVehicleVisitor->actualValue = '82968.95';
        //座位数
        $premiumVehicleVisitor->vehicleSeat = '5';
        //使用性质
        $premiumVehicleVisitor->useNatureCode = '01';
        //所属性质
        $premiumVehicleVisitor->attachNature = '01';
        //车辆用途
        $premiumVehicleVisitor->causeType = '001';
        //车辆种类
        $premiumVehicleVisitor->carKindCode = '100';
        //能源类型代码
        $premiumVehicleVisitor->energyTypeCode = 'E01';
        //号牌颜色代码
        $premiumVehicleVisitor->licenseColorCode = '01';
        //号牌种类代码
        $premiumVehicleVisitor->licenseTypeCode = '02';
        //交管车辆类型代码
        $premiumVehicleVisitor->vehicleStyleCode = 'K33';
        //功率
        $premiumVehicleVisitor->power = '79.0';
        //排量
        $premiumVehicleVisitor->vehicleExhaust = '1.496';
        //整备质量
        $premiumVehicleVisitor->wholeWeight = '10.2';
        //荷载质量
        $premiumVehicleVisitor->vehicleTonnage = '0.0';
        //进口标识
        $premiumVehicleVisitor->vehicleImport = 'I2';
        //是否能源车
        $premiumVehicleVisitor->isNewEnergy = '0';
        //纯电续航里程(公里)
        $premiumVehicleVisitor->pureRange = '';
        //车辆来历凭证编号
        $premiumVehicleVisitor->carCertificateNo = '';
        //开具车辆来历凭证所载日期
        $premiumVehicleVisitor->carCertificateDate = '';
        //车辆来历凭证种类代码
        $premiumVehicleVisitor->carCertificateType = '';

        /**
         * 关系人
         */
        $premiumRelationVisitor = new PremiumRelationVisitor();
        //姓名
        $premiumRelationVisitor->name = '樊鑫';
        //联系方式
        $premiumRelationVisitor->mobile = '13550217453';
        //类型
        $premiumRelationVisitor->typeCode = 'R1';
        //证件类型
        $premiumRelationVisitor->certificateTypeCode = '01';
        //证件号码
        $premiumRelationVisitor->certificateNo = '51390219960714105X';
        //地址
        $premiumRelationVisitor->address = '四川省成都市龙泉驿区龙泉车城西一路185号1栋1单元20楼2001号';
        //邮箱
        $premiumRelationVisitor->email = '18982272991@qq.com';
        //证件有效期
        $premiumRelationVisitor->certificateStartDate = '2000-01-01';
        //证件失效期
        $premiumRelationVisitor->certificateEndDate = '2050-01-01';

        /**
         * 缴税信息
         */
        $premiumCarTaxVisitor = new PremiumCarTaxVisitor();
        //缴税内心
        $premiumCarTaxVisitor->taxTypeCode = 'T01';
        //纳税人姓名
        $premiumCarTaxVisitor->taxpayerName = '樊鑫';
        //纳税人证件类型
        $premiumCarTaxVisitor->taxpayerCertificateTypeCode = '01';
        //纳税人证件号码
        $premiumCarTaxVisitor->taxpayerCertificateNo = '51390219960714105X';
        //纳税人电话
        $premiumCarTaxVisitor->taxpayerPhone = '13550217453';
        //纳税起期
        $premiumCarTaxVisitor->taxStartDate = '2023-08-10 00:00:00';
        //纳税止期
        $premiumCarTaxVisitor->taxEndDate = '2024-08-09 23:59:59';
        //减免税方案代码
        $premiumCarTaxVisitor->taxReductionCode = '';
        //减免税原因代码
        $premiumCarTaxVisitor->taxReductionReasonCode = '';
        //税务机关名称
        $premiumCarTaxVisitor->taxDepartment = '';
        //税务机关代码
        $premiumCarTaxVisitor->taxDepartmentCode = '';
        //开具完税凭证地区代码
        $premiumCarTaxVisitor->taxPaidAreaCode = '';
        //完税凭证填发日期
        $premiumCarTaxVisitor->taxDocumentDate = '';
        //减免比例 百分比
        $premiumCarTaxVisitor->taxFreeRate = '';
        //减税金额 元
        $premiumCarTaxVisitor->taxExemption = '';
        //减免完税凭证号
        $premiumCarTaxVisitor->taxDocumentNumber = '';

        //险种

        //
        $premiumCoverageVisitor = new PremiumCoverageVisitor();
        $premiumCoverageVisitor->coverageCode = 'C01001';
        $premiumCoverageVisitor->amount = '950';

        $premiumCoverageVisitor1 = new PremiumCoverageVisitor();
        $premiumCoverageVisitor1->coverageCode = 'C05001';
        $premiumCoverageVisitor1->amount = '40000';
        $premiumCoverageVisitor1->unitAmount = '10000';
        $premiumCoverageVisitor1->deductionRate = '5';
//
        $premiumCoverageVisitor2 = new PremiumCoverageVisitor();
        $premiumCoverageVisitor2->coverageCode = 'C03001';
        $premiumCoverageVisitor2->amount = '1000000';
        $premiumCoverageVisitor2->deductionRate = '5';

        $premiumCoverageVisitor3 = new PremiumCoverageVisitor();
        $premiumCoverageVisitor3->coverageCode = 'C02001';
        $premiumCoverageVisitor3->amount = '82968.95';


        //新能源充电桩信息
        $premiumChargingPileVisitor = new PremiumChargingPileVisitor();

        $premiumChargingPileVisitor->seqNo = '1';
        //充电桩类型
        $premiumChargingPileVisitor->chargingPileKind = 'PK1';
        //充电桩安装地点类型
        $premiumChargingPileVisitor->chargingPileAddressType = 'PA1';
        //充电桩使用年限
        $premiumChargingPileVisitor->chargingPileYearLimit = 'PY1';
        //充电桩编码
        $premiumChargingPileVisitor->chargingPileCode = '123456';
        //充电桩型号
        $premiumChargingPileVisitor->chargingPileType = 'BCS100500';
        //充电桩地址
        $premiumChargingPileVisitor->chargingPileAddress = '地面充电桩';
        //损失保险保额
        $premiumChargingPileVisitor->lossAmount = '';
        //责任保险保额
        $premiumChargingPileVisitor->liabilityAmount = '10000';

        /**
         * 拓展信息
         */
        $premiumExtInfoVisitor = new PremiumExtInfoVisitor();
        //验车情况
        $premiumExtInfoVisitor->carCheckCode = 'CS3';//已验
        //免验原因
        $premiumExtInfoVisitor->carCheckReasonKind = '';
        //验车人
        $premiumExtInfoVisitor->carChecker = '张三';
        //验车日期
        $premiumExtInfoVisitor->carCheckDate = '2023-08-02';
        //验车地点
        $premiumExtInfoVisitor->carAddress = '';
        //是否送修
        $premiumExtInfoVisitor->isMonopoly = '0';
        //送修代码
        $premiumExtInfoVisitor->repairCode = '';
        //送修名称
        $premiumExtInfoVisitor->repairName = '';
        //自主定价系数
        $premiumExtInfoVisitor->selfPricingFactor = '';
        //自主核保系数
        $premiumExtInfoVisitor->underwritingFactor = '';
        //期望折扣
        $premiumExtInfoVisitor->expectedDiscount = '0.9';
        //是否贷款车
        $premiumExtInfoVisitor->isLoanCar = '';
        //贷款机构名称
        $premiumExtInfoVisitor->loanOrg = '';

        //大家拓展
        $premiumExtInfoVisitor->argc['vhlType'] = '365001';
        $premiumExtInfoVisitor->argc['busiOpdpt'] = '07';
        $premiumExtInfoVisitor->argc['busiDptCde'] = '07000002';
        $premiumExtInfoVisitor->argc['busiBrkrCde'] = '000201500000';
        $premiumExtInfoVisitor->argc['busiOprCde'] = '00000020';
        $premiumExtInfoVisitor->argc['busiBsnsTyp'] = '19002';
        $premiumExtInfoVisitor->argc['busiSlsCde'] = '02000176';
        $premiumExtInfoVisitor->argc['busiRecommendCde'] = '02000176';
        $premiumExtInfoVisitor->argc['busiRecSubChannel'] = 'C999';
        $premiumExtInfoVisitor->argc['busiChannelSrc'] = '10';
        $premiumExtInfoVisitor->argc['busiDataSrc'] = 'G';
        $premiumExtInfoVisitor->argc['busiDataFlag'] = 'HX';

//        $premiumExtInfoVisitor->argc['orderNo'] = 'D2023080207000000207f3228b1ed254';
        $premiumExtInfoVisitor->argc['busiId'] = 'HXY17141871004353';

        //添加车辆信息
        $premiumInquiryVisitor->setVehicleVisitor($premiumVehicleVisitor);
        //添加投保人
        $premiumInquiryVisitor->setApplicantVisitor($premiumRelationVisitor);
        //添加被保人
        $premiumInquiryVisitor->setInsuredVisitor($premiumRelationVisitor);
        //添加车主
        $premiumInquiryVisitor->setOwnerVisitor($premiumRelationVisitor);
        //车船税
        $premiumInquiryVisitor->setCarTaxVisitor($premiumCarTaxVisitor);
        //险种添加
        $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor1);
        $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor2);
        $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor);
        $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor3);
        //新能源充电桩
        $premiumInquiryVisitor->chargingPileVisitorAppend($premiumChargingPileVisitor);
        //拓展信息
        $premiumInquiryVisitor->setExtInfoVisitor($premiumExtInfoVisitor);

        //询价前置
//        $response = $IDock->preInquiry($shortName, $premiumInquiryVisitor);
//        var_dump($response->isSuccess());
//        var_dump($response->getError());
//        /**
//         * @var $printer \IDock\Printer\preInquiryPrinter;
//         */
//        $printer = $response->getPrinter();
//        var_dump($printer->toArray());
//        exit;

        //询价
//        $response = $IDock->premiumInquiry($shortName, $premiumInquiryVisitor);
//        var_dump($response->isSuccess());
//        var_dump($response->getError());
//
//        /**
//         * @var $printer \IDock\Printer\Premium\PremiumInquiryPrinter;
//         */
//        $printer = $response->getPrinter();
//        if ($printer) {
//            var_dump($printer->toArray());
//        }
//
//        exit;

        /**
         * 核保信息
         */
        $premiumUnderwritingVisitor = new PremiumUnderwritingVisitor();
        $premiumUnderwritingVisitor->biInquiryNo = '0070003562023003766';
        $premiumUnderwritingVisitor->ciInquiryNo = '0070003202023003807';

        $premiumUnderwritingVisitor->agreement = [];

        $premiumInquiryVisitor->setUnderwritingVisitor($premiumUnderwritingVisitor);

        $nocarVisitor = new NonCarInquiryVisitor();
        $nocarVisitor->setApplicantVisitor($premiumRelationVisitor);
        $nocarVisitor->setInsuredVisitor($premiumRelationVisitor);
        $nocarVisitor->setVehicleVisitor($premiumVehicleVisitor);
        $premiumInquiryVisitor->setNonCarUnderwritingVisitor($nocarVisitor);

        //核保
        $response = $IDock->underwriting($shortName, $premiumInquiryVisitor);

        var_dump($response->isSuccess());
        var_dump($response->getError());

        /**
         * @var $printer \IDock\Printer\PremiumUnderwritingPrinter;
         */
        $printer = $response->getPrinter();

        if ($printer) var_dump($printer->toArray());
        exit;
    }

//支付
    if (0) {
        $policyPaymentVisitor = new PolicyPaymentVisitor();
        $policyPaymentVisitor->inquiryNo = '599510803602023000184';
        $policyPaymentVisitor->biInquiryNo = '';
        $policyPaymentVisitor->ciInquiryNo = '599510803602023000184';
        $policyPaymentVisitor->argc['orderNo'] = $DAJIAOrderNo;
        $policyPaymentVisitor->argc['busiOprCde'] = '00000020';
        $response = $IDock->policyPayment($shortName, $policyPaymentVisitor);

        var_dump($response->isSuccess());
        var_dump($response->getError());
        /**
         * @var $printer \IDock\Printer\PolicyPaymentPrinter
         */
        $printer = $response->getPrinter();

        var_dump($printer->toArray());
        exit;
    }

//影像资料上传
    if (0) {
        $uploadFileVisitor = new UploadFileVisitor();
        $uploadFileVisitor->inquiryNo = '';
        $uploadFileVisitor->biInquiryNo = '0070003562023003766';
        $uploadFileVisitor->ciInquiryNo = '0070003202023003807';

        $appType = 'G_HX';//一级代理和二级代理
        $orgNum = '07000002';//出单机构
        $oprId = '00000020';//操作员编码
        $upType = '2';//上传方式 1（文件流），2（ftp）
        $imageList = [
            [
                'imgName' => 'test111.jpg',//要求英文
//                'base64Img' => base64_encode(file_get_contents(__DIR__ . '/test.jpg')),//图片base64编码
                'filedSuffix' => 'jpg',//文件后缀
                'filedPath' => 'https://p0.itc.cn/q_70/images03/20220512/77ed76720a1f40ef94948761dda05655.jpeg',//图片地址 ftp模式必传
            ],
        ];

        $uploadFileVisitor->argc['orderNo'] = $DAJIAOrderNo;
        $uploadFileVisitor->argc['appCode'] = '80';
        $uploadFileVisitor->argc['dataId'] = '8001';
        $uploadFileVisitor->argc['appType'] = $appType;
        $uploadFileVisitor->argc['orgNum'] = $orgNum;
        $uploadFileVisitor->argc['oprId'] = $oprId;
        $uploadFileVisitor->argc['upType'] = $upType;
        $uploadFileVisitor->argc['imageList'] = $imageList;
        foreach ($imageList as $val) {
            $uploadFileVisitor->fileAppend('99', 'https://p0.itc.cn/q_70/images03/20220512/77ed76720a1f40ef94948761dda05655.jpeg', '');
        }

        $response = $IDock->uploadFile($shortName, $uploadFileVisitor);

        var_dump($response->isSuccess());
        var_dump($response->getError());

        /**
         * @var  $printer \IDock\Printer\UploadFilePrinter
         */
        $printer = $response->getPrinter();

        if ($printer) var_dump($printer->toArray());
        exit;
    }

//投保单查询
    if (0) {
        $proposalStatusVisitor = new ProposalStatusVisitor();

        $proposalStatusVisitor->inquiryNo = '599510803602023000279';
        $proposalStatusVisitor->biInquiryNo = '';
        $proposalStatusVisitor->ciInquiryNo = '599510803602023000279';
        $proposalStatusVisitor->argc['orderNo'] = $DAJIAOrderNo;
        $response = $IDock->proposalStatus($shortName, $proposalStatusVisitor);

        var_dump($response->isSuccess());
        var_dump($response->getError());

        /*** @var $printer ProposalStatusPrinter; */
        $printer = $response->getPrinter();

        var_dump($printer);
        exit;
    }

//撤单
    if (0) {
        $proposalRecallVisitor = new ProposalRecallVisitor();

        $proposalRecallVisitor->inquiryNo = '599510803682023000036';
        $proposalRecallVisitor->biInquiryNo = '';
        $proposalRecallVisitor->ciInquiryNo = '599510803682023000036';
        $proposalRecallVisitor->reason = '客户注销';
        $proposalRecallVisitor->argc['OrgCode'] = '51080503';

        $response = $IDock->proposalRecall($shortName, $proposalRecallVisitor);

        var_dump($response->isSuccess());
        var_dump($response->getError());

        /**
         * @var $printer \IDock\Printer\ProposalRecallPrinter
         */
        $printer = $response->getPrinter();
        var_dump($printer->toArray());
        exit;
    }

//核保撤单
    if (0) {
        $underwritingRecallVisitor = new UnderwritingRecallVisitor();

        $underwritingRecallVisitor->inquiryNo = '599510803682023000036';
        $underwritingRecallVisitor->biInquiryNo = '';
        $underwritingRecallVisitor->ciInquiryNo = '599510803682023000036';
        $underwritingRecallVisitor->reason = '投保注销';
        $underwritingRecallVisitor->argc['OrgCode'] = '51080503';


        $underwritingRecallVisitor->argc['orderNo'] = $DAJIAOrderNo;

        $response = $IDock->underwritingRecall($shortName, $underwritingRecallVisitor);

        var_dump($response->isSuccess());
        var_dump($response->getError());

        /**
         * @var $printer \IDock\Printer\UnderwritingRecallPrinter
         */
        $printer = $response->getPrinter();
        var_dump($printer->toArray());
        exit;

    }

//电子保单下载
    if (0) {
        $EPolicyDownloadVisitor = new EPolicyDownloadVisitor();

        $EPolicyDownloadVisitor->policyNo = '2080003582023002364';

        $response = $IDock->EPolicyDownload($shortName, $EPolicyDownloadVisitor);

        var_dump($response->isSuccess());
        var_dump($response->getError());


        /**
         * @var $printer \IDock\Printer\EPolicyDownloadPrinter
         */
        $printer = $response->getPrinter();
        var_dump($printer);
        exit;
    }

//保单详情
    if (0) {
        $policyInfoVisitor = new PolicyInfoVisitor();

        $policyInfoVisitor->policyNo = '299510803602023000033';
        $policyInfoVisitor->argc['orderNo'] = $DAJIAOrderNo;
        $response = $IDock->policyInfo($shortName, $policyInfoVisitor);
        var_dump($response->isSuccess());
        var_dump($response->getError());
        var_dump($response->getPrinter()->toArray());
        exit;
    }

    if (1) {
        $policyInfoVisitor = new NonCarPaymentVisitor();

        $policyInfoVisitor->inquiryNo = '00700067923A100009W';
        $demo = $IDock->getBean('DAJIA');
        $response = $demo->nonCarOrderQuery($policyInfoVisitor);
        var_dump($response->isSuccess());
        var_dump($response->getError());
        var_dump($response->getPrinter()->toArray());
        exit;
    }

} catch (Exception $e) {
    var_dump($e->getMessage());
}
